/*   1:    */ package org.intellij.lang.regexp;
/*   2:    */ 
/*   3:    */

import com.intellij.lang.ASTNode;
import com.intellij.lang.PsiBuilder;
import com.intellij.lang.PsiBuilder.Marker;
import com.intellij.lang.PsiParser;
import com.intellij.psi.StringEscapesTokenTypes;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.EnumSet;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */ 
/*  14:    */ public class RegExpParser
/*  15:    */   implements PsiParser
/*  16:    */ {
/*  17:    */   private final EnumSet<RegExpCapability> a;
/*  18:    */   
/*  19:    */   public RegExpParser()
/*  20:    */   {
/*  21: 33 */     this.a = EnumSet.noneOf(RegExpCapability.class);
/*  22:    */   }
/*  23:    */   
/*  24:    */   public RegExpParser(EnumSet<RegExpCapability> paramEnumSet)
/*  25:    */   {
/*  26: 37 */     this.a = paramEnumSet;
/*  27:    */   }
/*  28:    */   
/*  29:    */   @NotNull
/*  30:    */   public ASTNode parse(IElementType paramIElementType, PsiBuilder paramPsiBuilder)
/*  31:    */   {
/*  32: 43 */     PsiBuilder.Marker localMarker = paramPsiBuilder.mark();
/*  33:    */     
/*  34: 45 */     a(paramPsiBuilder);
/*  35: 47 */     while (!paramPsiBuilder.eof())
/*  36:    */     {
/*  37: 48 */       l(paramPsiBuilder);
/*  38: 49 */       paramPsiBuilder.advanceLexer();
/*  39:    */     }
/*  40: 52 */     localMarker.done(paramIElementType); ASTNode 
/*  41: 53 */       tmp48_43 = paramPsiBuilder.getTreeBuilt();
/*  42: 53 */     if (tmp48_43 == null) {
/*  43: 53 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/lang/regexp/RegExpParser", "parse" }));
/*  44:    */     }
/*  45: 53 */     return tmp48_43;
/*  46:    */   }
/*  47:    */   
/*  48:    */   private boolean a(PsiBuilder paramPsiBuilder)
/*  49:    */   {
/*  50: 61 */     PsiBuilder.Marker localMarker = paramPsiBuilder.mark();
/*  51: 63 */     if (!b(paramPsiBuilder))
/*  52:    */     {
/*  53: 64 */       localMarker.drop();
/*  54: 65 */       return false;
/*  55:    */     }
/*  56: 68 */     while (paramPsiBuilder.getTokenType() == RegExpTT.UNION)
/*  57:    */     {
/*  58: 69 */       paramPsiBuilder.advanceLexer();
/*  59: 70 */       if (!b(paramPsiBuilder)) {
/*  60: 72 */         l(paramPsiBuilder);
/*  61:    */       }
/*  62:    */     }
/*  63: 77 */     localMarker.done(RegExpElementTypes.PATTERN);
/*  64:    */     
/*  65: 79 */     return true;
/*  66:    */   }
/*  67:    */   
/*  68:    */   private boolean b(PsiBuilder paramPsiBuilder)
/*  69:    */   {
/*  70: 87 */     PsiBuilder.Marker localMarker = paramPsiBuilder.mark();
/*  71: 89 */     if (!c(paramPsiBuilder))
/*  72:    */     {
/*  73: 90 */       IElementType localIElementType = paramPsiBuilder.getTokenType();
/*  74: 91 */       if ((localIElementType == RegExpTT.GROUP_END) || (localIElementType == RegExpTT.UNION) || (localIElementType == null))
/*  75:    */       {
/*  76: 93 */         localMarker.done(RegExpElementTypes.BRANCH);
/*  77: 94 */         return true;
/*  78:    */       }
/*  79: 96 */       localMarker.drop();
/*  80: 97 */       return false;
/*  81:    */     }
/*  82:100 */     while (c(paramPsiBuilder)) {}
/*  83:102 */     localMarker.done(RegExpElementTypes.BRANCH);
/*  84:103 */     return true;
/*  85:    */   }
/*  86:    */   
/*  87:    */   private boolean c(PsiBuilder paramPsiBuilder)
/*  88:    */   {
/*  89:111 */     PsiBuilder.Marker localMarker = j(paramPsiBuilder);
/*  90:113 */     if (localMarker == null) {
/*  91:114 */       return false;
/*  92:    */     }
/*  93:116 */     localMarker = localMarker.precede();
/*  94:118 */     if (d(paramPsiBuilder)) {
/*  95:119 */       localMarker.done(RegExpElementTypes.CLOSURE);
/*  96:    */     } else {
/*  97:122 */       localMarker.drop();
/*  98:    */     }
/*  99:125 */     return true;
/* 100:    */   }
/* 101:    */   
/* 102:    */   private boolean d(PsiBuilder paramPsiBuilder)
/* 103:    */   {
/* 104:135 */     PsiBuilder.Marker localMarker = paramPsiBuilder.mark();
/* 105:137 */     if (paramPsiBuilder.getTokenType() == RegExpTT.LBRACE)
/* 106:    */     {
/* 107:138 */       paramPsiBuilder.advanceLexer();
/* 108:139 */       int i = 0;
/* 109:140 */       if ((paramPsiBuilder.getTokenType() == RegExpTT.COMMA) && (this.a.contains(RegExpCapability.OMIT_NUMBERS_IN_QUANTIFIERS)))
/* 110:    */       {
/* 111:141 */         i = 1;
/* 112:142 */         paramPsiBuilder.advanceLexer();
/* 113:    */       }
/* 114:    */       else
/* 115:    */       {
/* 116:144 */         if ((paramPsiBuilder.getTokenType() != RegExpTT.NUMBER) && (this.a.contains(RegExpCapability.DANGLING_METACHARACTERS)))
/* 117:    */         {
/* 118:145 */           localMarker.done(RegExpTT.CHARACTER);
/* 119:146 */           return true;
/* 120:    */         }
/* 121:149 */         checkMatches(paramPsiBuilder, RegExpTT.NUMBER, "Number expected");
/* 122:    */       }
/* 123:151 */       if (paramPsiBuilder.getTokenType() == RegExpTT.RBRACE)
/* 124:    */       {
/* 125:152 */         paramPsiBuilder.advanceLexer();
/* 126:153 */         e(paramPsiBuilder);
/* 127:154 */         localMarker.done(RegExpElementTypes.QUANTIFIER);
/* 128:    */       }
/* 129:    */       else
/* 130:    */       {
/* 131:157 */         if (i == 0) {
/* 132:158 */           checkMatches(paramPsiBuilder, RegExpTT.COMMA, "',' expected");
/* 133:    */         }
/* 134:160 */         if (paramPsiBuilder.getTokenType() == RegExpTT.RBRACE)
/* 135:    */         {
/* 136:161 */           paramPsiBuilder.advanceLexer();
/* 137:162 */           e(paramPsiBuilder);
/* 138:163 */           localMarker.done(RegExpElementTypes.QUANTIFIER);
/* 139:    */         }
/* 140:165 */         else if (paramPsiBuilder.getTokenType() == RegExpTT.NUMBER)
/* 141:    */         {
/* 142:166 */           paramPsiBuilder.advanceLexer();
/* 143:167 */           checkMatches(paramPsiBuilder, RegExpTT.RBRACE, "'}' expected");
/* 144:168 */           e(paramPsiBuilder);
/* 145:169 */           localMarker.done(RegExpElementTypes.QUANTIFIER);
/* 146:    */         }
/* 147:    */         else
/* 148:    */         {
/* 149:172 */           paramPsiBuilder.error("'}' or number expected");
/* 150:173 */           localMarker.done(RegExpElementTypes.QUANTIFIER);
/* 151:174 */           return true;
/* 152:    */         }
/* 153:    */       }
/* 154:    */     }
/* 155:178 */     else if (RegExpTT.QUANTIFIERS.contains(paramPsiBuilder.getTokenType()))
/* 156:    */     {
/* 157:179 */       paramPsiBuilder.advanceLexer();
/* 158:180 */       e(paramPsiBuilder);
/* 159:181 */       localMarker.done(RegExpElementTypes.QUANTIFIER);
/* 160:    */     }
/* 161:    */     else
/* 162:    */     {
/* 163:184 */       localMarker.drop();
/* 164:185 */       return false;
/* 165:    */     }
/* 166:188 */     return true;
/* 167:    */   }
/* 168:    */   
/* 169:    */   private static void e(PsiBuilder paramPsiBuilder)
/* 170:    */   {
/* 171:192 */     if (paramPsiBuilder.getTokenType() == RegExpTT.PLUS) {
/* 172:193 */       paramPsiBuilder.advanceLexer();
/* 173:195 */     } else if (paramPsiBuilder.getTokenType() == RegExpTT.QUEST) {
/* 174:196 */       paramPsiBuilder.advanceLexer();
/* 175:199 */     } else if (RegExpTT.QUANTIFIERS.contains(paramPsiBuilder.getTokenType())) {
/* 176:200 */       paramPsiBuilder.error("Dangling metacharacter");
/* 177:    */     }
/* 178:    */   }
/* 179:    */   
/* 180:    */   private PsiBuilder.Marker f(PsiBuilder paramPsiBuilder)
/* 181:    */   {
/* 182:214 */     PsiBuilder.Marker localMarker = paramPsiBuilder.mark();
/* 183:215 */     paramPsiBuilder.advanceLexer();
/* 184:217 */     if (paramPsiBuilder.getTokenType() == RegExpTT.CARET) {
/* 185:218 */       paramPsiBuilder.advanceLexer();
/* 186:    */     }
/* 187:222 */     if (g(paramPsiBuilder)) {
/* 188:223 */       while ((RegExpTT.CHARACTERS2.contains(paramPsiBuilder.getTokenType())) || (paramPsiBuilder.getTokenType() == RegExpTT.CLASS_BEGIN) || (paramPsiBuilder.getTokenType() == RegExpTT.PROPERTY)) {
/* 189:226 */         g(paramPsiBuilder);
/* 190:    */       }
/* 191:    */     }
/* 192:230 */     checkMatches(paramPsiBuilder, RegExpTT.CLASS_END, "Unclosed character class");
/* 193:231 */     localMarker.done(RegExpElementTypes.CLASS);
/* 194:232 */     return localMarker;
/* 195:    */   }
/* 196:    */   
/* 197:    */   private boolean g(PsiBuilder paramPsiBuilder)
/* 198:    */   {
/* 199:236 */     PsiBuilder.Marker localMarker = paramPsiBuilder.mark();
/* 200:238 */     if (!a(paramPsiBuilder, false))
/* 201:    */     {
/* 202:239 */       localMarker.drop();
/* 203:240 */       return false;
/* 204:    */     }
/* 205:242 */     while (RegExpTT.ANDAND == paramPsiBuilder.getTokenType())
/* 206:    */     {
/* 207:243 */       paramPsiBuilder.advanceLexer();
/* 208:244 */       a(paramPsiBuilder, true);
/* 209:245 */       localMarker.done(RegExpElementTypes.INTERSECTION);
/* 210:246 */       localMarker = localMarker.precede();
/* 211:    */     }
/* 212:249 */     localMarker.drop();
/* 213:250 */     return true;
/* 214:    */   }
/* 215:    */   
/* 216:    */   private boolean a(PsiBuilder paramPsiBuilder, boolean paramBoolean)
/* 217:    */   {
/* 218:254 */     IElementType localIElementType = paramPsiBuilder.getTokenType();
/* 219:255 */     if (localIElementType == RegExpTT.CLASS_BEGIN)
/* 220:    */     {
/* 221:256 */       f(paramPsiBuilder);
/* 222:    */     }
/* 223:258 */     else if (RegExpTT.CHARACTERS2.contains(localIElementType))
/* 224:    */     {
/* 225:259 */       h(paramPsiBuilder);
/* 226:    */     }
/* 227:261 */     else if (localIElementType == RegExpTT.PROPERTY)
/* 228:    */     {
/* 229:262 */       k(paramPsiBuilder);
/* 230:    */     }
/* 231:    */     else
/* 232:    */     {
/* 233:264 */       if (paramBoolean) {
/* 234:266 */         return true;
/* 235:    */       }
/* 236:269 */       return false;
/* 237:    */     }
/* 238:271 */     return true;
/* 239:    */   }
/* 240:    */   
/* 241:    */   private void h(PsiBuilder paramPsiBuilder)
/* 242:    */   {
/* 243:275 */     assert (RegExpTT.CHARACTERS2.contains(paramPsiBuilder.getTokenType()));
/* 244:    */     
/* 245:277 */     PsiBuilder.Marker localMarker1 = paramPsiBuilder.mark();
/* 246:278 */     i(paramPsiBuilder);
/* 247:    */     
/* 248:280 */     IElementType localIElementType = paramPsiBuilder.getTokenType();
/* 249:281 */     if (localIElementType == RegExpTT.MINUS)
/* 250:    */     {
/* 251:282 */       PsiBuilder.Marker localMarker2 = paramPsiBuilder.mark();
/* 252:283 */       paramPsiBuilder.advanceLexer();
/* 253:    */       
/* 254:285 */       localIElementType = paramPsiBuilder.getTokenType();
/* 255:286 */       if (RegExpTT.CHARACTERS2.contains(localIElementType))
/* 256:    */       {
/* 257:287 */         localMarker2.drop();
/* 258:288 */         i(paramPsiBuilder);
/* 259:289 */         localMarker1.done(RegExpElementTypes.CHAR_RANGE);
/* 260:    */       }
/* 261:    */       else
/* 262:    */       {
/* 263:292 */         localMarker1.drop();
/* 264:293 */         localMarker2.done(localIElementType == RegExpTT.CHAR_CLASS ? RegExpElementTypes.SIMPLE_CLASS : RegExpElementTypes.CHAR);
/* 265:295 */         if (localIElementType == RegExpTT.CLASS_END) {
/* 266:296 */           return;
/* 267:    */         }
/* 268:298 */         if ((localIElementType == RegExpTT.CLASS_BEGIN) && 
/* 269:299 */           (a(paramPsiBuilder, false))) {
/* 270:300 */           return;
/* 271:    */         }
/* 272:303 */         paramPsiBuilder.error("Illegal character range");
/* 273:    */       }
/* 274:    */     }
/* 275:    */     else
/* 276:    */     {
/* 277:307 */       localMarker1.drop();
/* 278:    */     }
/* 279:    */   }
/* 280:    */   
/* 281:    */   private static void i(PsiBuilder paramPsiBuilder)
/* 282:    */   {
/* 283:312 */     IElementType localIElementType = paramPsiBuilder.getTokenType();
/* 284:313 */     PsiBuilder.Marker localMarker = paramPsiBuilder.mark();
/* 285:314 */     paramPsiBuilder.advanceLexer();
/* 286:315 */     localMarker.done(localIElementType == RegExpTT.CHAR_CLASS ? RegExpElementTypes.SIMPLE_CLASS : RegExpElementTypes.CHAR);
/* 287:    */   }
/* 288:    */   
/* 289:    */   @Nullable
/* 290:    */   private PsiBuilder.Marker j(PsiBuilder paramPsiBuilder)
/* 291:    */   {
/* 292:324 */     IElementType localIElementType = paramPsiBuilder.getTokenType();
/* 293:    */     
/* 294:326 */     PsiBuilder.Marker localMarker1 = paramPsiBuilder.mark();
/* 295:328 */     if (RegExpTT.GROUPS.contains(localIElementType))
/* 296:    */     {
/* 297:329 */       paramPsiBuilder.advanceLexer();
/* 298:330 */       if (!a(paramPsiBuilder)) {
/* 299:331 */         l(paramPsiBuilder);
/* 300:    */       } else {
/* 301:334 */         checkMatches(paramPsiBuilder, RegExpTT.GROUP_END, "Unclosed group");
/* 302:    */       }
/* 303:336 */       localMarker1.done(RegExpElementTypes.GROUP);
/* 304:    */     }
/* 305:338 */     else if (localIElementType == RegExpTT.SET_OPTIONS)
/* 306:    */     {
/* 307:339 */       paramPsiBuilder.advanceLexer();
/* 308:    */       
/* 309:341 */       PsiBuilder.Marker localMarker2 = paramPsiBuilder.mark();
/* 310:342 */       if (paramPsiBuilder.getTokenType() == RegExpTT.OPTIONS_ON) {
/* 311:343 */         paramPsiBuilder.advanceLexer();
/* 312:    */       }
/* 313:345 */       if (paramPsiBuilder.getTokenType() == RegExpTT.OPTIONS_OFF) {
/* 314:346 */         paramPsiBuilder.advanceLexer();
/* 315:    */       }
/* 316:348 */       localMarker2.done(RegExpElementTypes.OPTIONS);
/* 317:350 */       if (paramPsiBuilder.getTokenType() == RegExpTT.COLON)
/* 318:    */       {
/* 319:351 */         paramPsiBuilder.advanceLexer();
/* 320:352 */         if (!a(paramPsiBuilder)) {
/* 321:354 */           l(paramPsiBuilder);
/* 322:    */         } else {
/* 323:357 */           checkMatches(paramPsiBuilder, RegExpTT.GROUP_END, "Unclosed group");
/* 324:    */         }
/* 325:359 */         localMarker1.done(RegExpElementTypes.GROUP);
/* 326:    */       }
/* 327:    */       else
/* 328:    */       {
/* 329:362 */         checkMatches(paramPsiBuilder, RegExpTT.GROUP_END, "Unclosed options group");
/* 330:363 */         localMarker1.done(RegExpElementTypes.SET_OPTIONS);
/* 331:    */       }
/* 332:    */     }
/* 333:366 */     else if (localIElementType == StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN)
/* 334:    */     {
/* 335:367 */       paramPsiBuilder.error("Illegal/unsupported escape sequence");
/* 336:368 */       paramPsiBuilder.advanceLexer();
/* 337:369 */       localMarker1.done(RegExpElementTypes.CHAR);
/* 338:    */     }
/* 339:371 */     else if (RegExpTT.CHARACTERS.contains(localIElementType))
/* 340:    */     {
/* 341:372 */       paramPsiBuilder.advanceLexer();
/* 342:373 */       localMarker1.done(RegExpElementTypes.CHAR);
/* 343:    */     }
/* 344:375 */     else if (RegExpTT.BOUNDARIES.contains(localIElementType))
/* 345:    */     {
/* 346:376 */       paramPsiBuilder.advanceLexer();
/* 347:377 */       localMarker1.done(RegExpElementTypes.BOUNDARY);
/* 348:    */     }
/* 349:379 */     else if (localIElementType == RegExpTT.BACKREF)
/* 350:    */     {
/* 351:380 */       paramPsiBuilder.advanceLexer();
/* 352:381 */       localMarker1.done(RegExpElementTypes.BACKREF);
/* 353:    */     }
/* 354:383 */     else if ((localIElementType == RegExpTT.PYTHON_NAMED_GROUP) || (localIElementType == RegExpTT.RUBY_NAMED_GROUP) || (localIElementType == RegExpTT.RUBY_QUOTED_NAMED_GROUP))
/* 355:    */     {
/* 356:384 */       paramPsiBuilder.advanceLexer();
/* 357:385 */       checkMatches(paramPsiBuilder, RegExpTT.NAME, "Group name expected");
/* 358:386 */       checkMatches(paramPsiBuilder, localIElementType == RegExpTT.RUBY_QUOTED_NAMED_GROUP ? RegExpTT.QUOTE : RegExpTT.GT, "Unclosed group name");
/* 359:387 */       if (!a(paramPsiBuilder)) {
/* 360:388 */         l(paramPsiBuilder);
/* 361:    */       } else {
/* 362:391 */         checkMatches(paramPsiBuilder, RegExpTT.GROUP_END, "Unclosed group");
/* 363:    */       }
/* 364:393 */       localMarker1.done(RegExpElementTypes.GROUP);
/* 365:    */     }
/* 366:395 */     else if (localIElementType == RegExpTT.PYTHON_NAMED_GROUP_REF)
/* 367:    */     {
/* 368:396 */       paramPsiBuilder.advanceLexer();
/* 369:397 */       checkMatches(paramPsiBuilder, RegExpTT.NAME, "Group name expected");
/* 370:398 */       checkMatches(paramPsiBuilder, RegExpTT.GROUP_END, "Unclosed group reference");
/* 371:399 */       localMarker1.done(RegExpElementTypes.PY_NAMED_GROUP_REF);
/* 372:    */     }
/* 373:401 */     else if (localIElementType == RegExpTT.PYTHON_COND_REF)
/* 374:    */     {
/* 375:402 */       paramPsiBuilder.advanceLexer();
/* 376:403 */       if ((paramPsiBuilder.getTokenType() == RegExpTT.NAME) || (paramPsiBuilder.getTokenType() == RegExpTT.NUMBER)) {
/* 377:404 */         paramPsiBuilder.advanceLexer();
/* 378:    */       } else {
/* 379:407 */         paramPsiBuilder.error("Group name or number expected");
/* 380:    */       }
/* 381:409 */       checkMatches(paramPsiBuilder, RegExpTT.GROUP_END, "Unclosed group reference");
/* 382:410 */       if (!b(paramPsiBuilder))
/* 383:    */       {
/* 384:411 */         l(paramPsiBuilder);
/* 385:    */       }
/* 386:    */       else
/* 387:    */       {
/* 388:414 */         if (paramPsiBuilder.getTokenType() == RegExpTT.UNION)
/* 389:    */         {
/* 390:415 */           paramPsiBuilder.advanceLexer();
/* 391:416 */           if (!b(paramPsiBuilder)) {
/* 392:417 */             l(paramPsiBuilder);
/* 393:    */           }
/* 394:    */         }
/* 395:420 */         checkMatches(paramPsiBuilder, RegExpTT.GROUP_END, "Unclosed group");
/* 396:    */       }
/* 397:422 */       localMarker1.done(RegExpElementTypes.PY_COND_REF);
/* 398:    */     }
/* 399:424 */     else if (localIElementType == RegExpTT.PROPERTY)
/* 400:    */     {
/* 401:425 */       k(paramPsiBuilder);
/* 402:426 */       localMarker1.done(RegExpElementTypes.PROPERTY);
/* 403:    */     }
/* 404:428 */     else if (RegExpTT.SIMPLE_CLASSES.contains(localIElementType))
/* 405:    */     {
/* 406:429 */       paramPsiBuilder.advanceLexer();
/* 407:430 */       localMarker1.done(RegExpElementTypes.SIMPLE_CLASS);
/* 408:    */     }
/* 409:    */     else
/* 410:    */     {
/* 411:432 */       if (localIElementType == RegExpTT.CLASS_BEGIN)
/* 412:    */       {
/* 413:433 */         localMarker1.drop();
/* 414:434 */         return f(paramPsiBuilder);
/* 415:    */       }
/* 416:436 */       if ((localIElementType == RegExpTT.LBRACE) && (this.a.contains(RegExpCapability.DANGLING_METACHARACTERS)))
/* 417:    */       {
/* 418:437 */         paramPsiBuilder.advanceLexer();
/* 419:438 */         localMarker1.done(RegExpElementTypes.CHAR);
/* 420:    */       }
/* 421:    */       else
/* 422:    */       {
/* 423:441 */         localMarker1.drop();
/* 424:442 */         return null;
/* 425:    */       }
/* 426:    */     }
/* 427:444 */     return localMarker1;
/* 428:    */   }
/* 429:    */   
/* 430:    */   private static void k(PsiBuilder paramPsiBuilder)
/* 431:    */   {
/* 432:448 */     checkMatches(paramPsiBuilder, RegExpTT.PROPERTY, "'\\p' expected");
/* 433:    */     
/* 434:450 */     checkMatches(paramPsiBuilder, RegExpTT.LBRACE, "Character category expected");
/* 435:451 */     if (paramPsiBuilder.getTokenType() == RegExpTT.NAME)
/* 436:    */     {
/* 437:452 */       paramPsiBuilder.advanceLexer();
/* 438:    */     }
/* 439:454 */     else if (paramPsiBuilder.getTokenType() == RegExpTT.RBRACE)
/* 440:    */     {
/* 441:455 */       paramPsiBuilder.error("Empty character family");
/* 442:    */     }
/* 443:    */     else
/* 444:    */     {
/* 445:458 */       paramPsiBuilder.error("Character family name expected");
/* 446:459 */       paramPsiBuilder.advanceLexer();
/* 447:    */     }
/* 448:461 */     checkMatches(paramPsiBuilder, RegExpTT.RBRACE, "Unclosed character family");
/* 449:    */   }
/* 450:    */   
/* 451:    */   private static void l(PsiBuilder paramPsiBuilder)
/* 452:    */   {
/* 453:465 */     IElementType localIElementType = paramPsiBuilder.getTokenType();
/* 454:466 */     if (localIElementType == RegExpTT.GROUP_END) {
/* 455:467 */       paramPsiBuilder.error("Unmatched closing ')'");
/* 456:469 */     } else if (RegExpTT.QUANTIFIERS.contains(localIElementType)) {
/* 457:470 */       paramPsiBuilder.error("Dangling metacharacter");
/* 458:    */     } else {
/* 459:473 */       paramPsiBuilder.error("Pattern expected");
/* 460:    */     }
/* 461:    */   }
/* 462:    */   
/* 463:    */   protected static void checkMatches(PsiBuilder paramPsiBuilder, IElementType paramIElementType, String paramString)
/* 464:    */   {
/* 465:478 */     if (paramPsiBuilder.getTokenType() == paramIElementType) {
/* 466:479 */       paramPsiBuilder.advanceLexer();
/* 467:    */     } else {
/* 468:482 */       paramPsiBuilder.error(paramString);
/* 469:    */     }
/* 470:    */   }
/* 471:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.lang.regexp.RegExpParser

 * JD-Core Version:    0.7.0.1

 */